package lumis.portal.htmlevaluation;

import java.util.ArrayList;
import java.util.List;

import org.w3c.tidy.TidyMessage;
import org.w3c.tidy.TidyMessageListener;

/**
 * {@link #TidyMessageListener} implementation used to stores the 
 * messages founded during accessibility evaluation process.
 * 
 * @version $Revision: 13093 $ $Date: 2011-05-28 18:40:18 -0300 (Sat, 28 May 2011) $
 * @since 6.0.0
 */
class HtmlEvaluationTidyMessageListener implements TidyMessageListener
{
	/**
	 * List of messages founded.
	 * @since 6.0.0
	 */
	private List<HtmlEvaluationMessage> messages = new ArrayList<HtmlEvaluationMessage>();
	
	/**
	 * Stores the messages founded.
	 * @since 6.0.0
	 */
	public void messageReceived(TidyMessage tidyMessage)
	{
		HtmlEvaluationMessage message = new HtmlEvaluationMessage(tidyMessage);
		messages.add(message);
	}
	
	/**
	 * Returns the list of messages.
	 * @return list of messages.
	 * @since 6.0.0
	 */
	public List<HtmlEvaluationMessage> getMessages()
	{
		return messages;
	}	
}